<template>
	<view class="register_header_warp">
		<up-image src="/static/comm/left.png" width="20" height="20" bgColor="#f1f6ff00" @click="leftJump"></up-image>
		<view class="title_">{{title}}</view>
		<view>{{rightTitle}}</view>
	</view>
</template>

<script>
	
	
	export default {
		name:"header_comm",
		props: {
			title:{
				type: String,
				default: null
			},
			leftPath:{
				type: String,
				default: null
			},
			leftPathType:{
				type: String,
				default: "navigateTo"
			},
			rightTitle:{
				type: String,
				default: null
			},
			rightPath:{
				type: String,
				default: null
			},
			rightPathType:{
				type: String,
				default: "navigateTo"
			},
		},
		data() {
			return {
				
			};
		},
		methods: {
			leftJump() {
				const leftPath = this.leftPath;
				if(!leftPath){
					return;
				}
				const leftPathType = this.leftPathType;
				if(leftPathType === "navigateTo"){
					uni.navigateTo({
						url:leftPath,
					})
				}else if(leftPathType === "switchTab"){
					uni.switchTab({ 
						url: leftPath,
					});
				}
			},
		}
	}
</script>

<style lang="scss">
.register_header_warp{
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 100rpx 30rpx 20rpx;
	.title_{
		font-weight: bold;
		font-size: 36rpx;
		
	}
}
</style>